<?php

/**
 * 查询订单
 */
if (!defined('IN_CRONLITE')) die();
$User = login_data::user_data();
?>
<!DOCTYPE html>
<html lang="zh" style="font-size: 102.4px;<?= background::image() == false ? 'background:linear-gradient(to left, #70e1f5, #ffd194);' : background::image() ?>">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover,user-scalable=no">
    <script>
        document.documentElement.style.fontSize = document.documentElement.clientWidth / 750 * 40 + "px";
    </script>
    <meta name="format-detection" content="telephone=no">
    <meta name="csrf-param" content="_csrf">
    <meta name="csrf-token" content="201LTF3q2tij2vn-BETmAv-IWRi93YNTLfQ2YubgZ1WzfQIfAoGDrpWJvLVlEZBgl_JrQtix6RJnnmAsiNczHQ==">
    <meta name="viewport" content="width=device-width, viewport-fit=cover">
    <title><?= $conf['sitename'] . ($conf['title'] == '' ? '' : ' - ' . $conf['title']) ?></title>
    <meta name="keywords" content="<?= $conf['keywords'] ?>">
    <meta name="description" content="<?= $conf['description'] ?>">

    <link rel="stylesheet" type="text/css" href="<?php echo $cdnserver; ?>assets/layui/css/layui.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo $cdnserver; ?>assets/template/cool/assets/css/foxui.css">
    <link rel="stylesheet" type="text/css" href="<?php echo $cdnserver; ?>assets/template/cool/assets/css/style.css">
    <link rel="stylesheet" type="text/css" href="<?php echo $cdnserver; ?>assets/template/cool/assets/css/foxui.diy.css">
    <link rel="shortcut icon" href="/assets/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" type="text/css" href="<?php echo $cdnserver; ?>assets/template/cool/assets/css/iconfont.css">

    <link href="<?php echo $cdnpublic; ?>font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
    <script src="<?php echo $cdnpublic; ?>modernizr/2.8.3/modernizr.min.js"></script>
    <link rel="stylesheet" type="text/css" href="<?php echo $cdnserver; ?>assets/layui/css/layui.css" />
</head>
<script>
    window.alert = function(name) {
        const iframe = document.createElement('IFRAME');
        iframe.style.display = 'none';
        iframe.setAttribute('src', 'data:text/plain,');
        document.documentElement.appendChild(iframe);
        window.frames[0].window.alert(name);
        iframe.parentNode.removeChild(iframe);
    };
</script>
<style>
    .fix-iphonex-bottom {
        padding-bottom: 34px;
    }

    body {
        width: 100%;
        max-width: 648px;
        margin: auto;
    }

    .fui-tab.fui-tab-primary a.active {
        color: #1492fb;
        border-color: #1492fb;
    }

    .qt-header {
        display: none;
        height: 8vh;
        line-height: 8vh;
        background-color: #f2f2f2;
    }

    .qt-header>input {
        height: 5vh;
        width: 100%;
        border: none;
        text-indent: 2.5em;
        line-height: 5vh;
        border-radius: 0.5em;
        font-size: 0.7rem;
    }

    .qt-header>span {
        position: absolute;
        margin-left: 0.6rem;
        font-size: 0.7rem;
    }

    .qt-card {
        box-shadow: 0px 0px 6px #eee;
        border-radius: 0.5em;
    }

    .qt-card img {
        width: 6em;
        max-width: 100%;
        height: 6em;
        border-radius: 0.5em;
        box-shadow: 3px 3px 16px #eee;
    }

    .qt-btn {
        border-radius: 0.5em;
        border: solid 1px #eee;
    }
</style>

<body>
    <div id="appquery" style="width: 100%;max-width: 648px">
        <div class="fui-page-group statusbar" style="max-width: 650px;left: auto;overflow: auto;">
            <div class="layui-row layui-col-space6">
                <div class="layui-card">
                    <div class="layui-card-header" style="text-align: center;font-size: 0.9rem;box-shadow: 3px 3px 16px #eee;color: #333;margin-bottom: 0.5rem;">
                        订单管理
                        <a href="javascript:hiset()" class="layui-icon layui-icon-search" id="sicon" style="position:absolute;left: 1rem"></a>
                    </div>
                    <div class="layui-card-header qt-header">
                        <span class="layui-icon layui-icon-search" @click="GetOrderList(-2)"></span>
                        <input type="text" id="query" v-model="seek" placeholder="搜索我的订单" autocomplete="off">
                        <div class="layui-btn-group" style="width: 100%;background-color: #fff;">
                            <button @click="GetOrderList(-2)" type="button" class="layui-btn  layui-btn-fluid layui-btn-sm" style="width: 50%;">查询有绑订单</button>
                            <button @click="GetOrderList(-3)" type="button" class="layui-btn  layui-btn-fluid layui-btn-warm layui-btn-sm" style="width: 50%;">查询游客订单</button>
                        </div>
                    </div>
                    <div class="page-body">
                        <div class="signin-card card-block auth-body mr-auto ml-auto">
                            <div class="card" style="padding: 1em;">
                                <div class="card-block" style="margin-bottom: 3em;">
                                    <div class="bl_more">
                                        <div class="text-left">
                                            <ul class="pagination">
                                                <li>
                                                    <span class="rows">共 {{ OrderData.length }} 条订单</span>
                                                </li>
                                                <li <?= ($User == false ? '' : 'style="display: none;"') ?>>
                                                    <a style="color: red;" href="/user">检测到您未登陆，登陆后可绑定订单，他人无法查询，保护您的购买信息，点我登陆！</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                    <div style="box-shadow: 3px 3px 16px #eee;padding: 0.5em;margin-bottom: 1em;border-radius: 0.5em;" v-for="(item, index) in OrderData">
                                        <span v-if="item.state==1" class="layui-badge" style="background-color: #00E676">已完成</span>
                                        <span v-else-if="item.state==2" class="layui-badge" style="background-color: #40C4FF">待处理</span>

                                        <span v-else-if="item.state==3" class="layui-badge" style="background-color: #FF5252">异常中</span>

                                        <span v-else-if="item.state==4" class="layui-badge" style="background-color: #FFD54F">处理中</span>

                                        <span v-else-if="item.state==5" class="layui-badge" style="background-color: #A6A6A6">已退款</span>

                                        <span v-else-if="item.state==6" class="layui-badge" style="background-color: #ff4254">售后中</span>

                                        <span v-else-if="item.state==7" class="layui-badge" style="background-color: #18b50c">已评价</span>

                                        <span v-else class="layui-badge" style="background-color: #A6A6A6">未知</span>

                                        订单号: {{ item.order }}
                                        <hr />
                                        <h4 style="color: forestgreen;">下单信息：</h4>
                                        <span v-for="(items, ins) in item.input">
                                            {{ (item.value[ins]==unll?'输入框'+(ins+1):item.value[ins]) }} ：{{ items }}
                                            <br />
                                        </span>
                                        <hr />
                                        <h4 v-if="item.Token.length>=1" style="color: salmon;">卡密信息：</h4>
                                        <span v-for="(items, ins) in item.Token">
                                            卡{{ (ins+1) +'：' + items.token }}
                                            <br />
                                        </span>
                                        <hr v-if="item.Token.length>=1" />
                                        <h4 v-if="item.RemarkType==2" style="color: darkcyan;">物流单号：</h4>
                                        {{ item.remark }}
                                        <hr v-if="item.RemarkType==2" />
                                        <h4>
                                            商品：
                                            <a :href="'/?mod=buy&gid=' + item.gid">{{ item.name }}</a>
                                        </h4>
                                        <span v-if="item.coupon!=-1">
                                            付款金额：
                                            <font color="red" size="3">{{ item.price }}元<span class="layui-word-aux" style="font-size:0.8em;text-decoration:line-through;">{{
                                                    item.originalprice }}元</span></font>
                                        </span>
                                        <span v-else>
                                            付款金额：
                                            <font color="blue">{{ item.price + (item.payment != '积分兑换' ? '元' : item.currency) }}</font>
                                        </span>

                                        <br />
                                        付款方式：
                                        <font color="blue">{{ item.payment }}</font>
                                        <br />
                                        付款时间：
                                        <font color="blue">{{ item.addtime }}</font>

                                        <a target="_blank" :href="Tracking + item.remark" v-if="item.RemarkType==2" class="btn layui-btn layui-btn-sm layui-btn-radius" style="float: right;margin-top: -5em;background-color: darkorange;color:#fff">物流</a>

                                        <button @click="GetQuery(item.id)" class="btn layui-btn layui-btn-sm layui-btn-radius" style="float: right;margin-top: -2em;background-color: #9575CD;color:#fff">详情</button>

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <style>
                .fui-navbar .label {
                    margin-top: 0.3em;
                }
            </style>
            <div class="fui-navbar" style="max-width: 650px;padding-top: 0.1em">
                <a href="index.php" class="nav-item  "> <span class="icon icon-home"></span> <span class="label">首页</span>
                </a>
                <a href="/?mod=query" class="nav-item "> <span class="icon icon-dingdan1"></span> <span class="label">订单</span> </a>
                <a href="/?mod=kf" class="nav-item "> <span class="icon icon-qq"></span> <span class="label">客服</span> </a>
                <a href="/user/" class="nav-item "> <span class="icon icon-person2"></span> <span class="label">会员中心</span> </a>
            </div>

        </div>
    </div>
    <script src="<?php echo $cdnpublic; ?>jquery/1.12.4/jquery.min.js"></script>
    <script src="<?php echo $cdnpublic; ?>jquery.lazyload/1.9.1/jquery.lazyload.min.js"></script>
    <script src="<?php echo $cdnpublic; ?>twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="<?php echo $cdnpublic; ?>jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
    <script src="<?php echo $cdnpublic; ?>layer/2.3/layer.js"></script>
    <script src="<?php echo $cdnpublic; ?>jquery/3.4.1/jquery.min.js"></script>
    <script src="<?php echo $cdnserver; ?>assets/layui/layui.all.js"></script>
    <script src="<?php echo $cdnserver; ?>assets/js/vue3.js"></script>
    <script src="<?php echo $cdnserver; ?>assets/template/cool/assets/js/query.js?vs=<?= $accredit['versions'] ?>"></script>
</body>

</html>